package com.hs.srm.admin.modules.pricemanagement.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.hs.srm.admin.modules.requisition.entity.NproPurchRequestItemEntity;
import com.hs.srm.base.common.annotation.DictMapping;
import com.hs.srm.base.common.base.CloneableEntity;
import com.hs.srm.base.common.utils.DictDataUtil;
import com.hs.srm.base.common.utils.DictDataUtil.DictType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 报价单
 *
 * @author yanfei
 * @date 2019年3月1日
 */
@Setter
@Getter
@TableName("inquiry_quotation")
@ToString
public class InquiryQuotationEntity implements Serializable, CloneableEntity<InquiryQuotationEntity> {

    public static final int STATE_CHUSHI = 0xffffffff;// 初始状态
    public static final int STATE_CAOGAO = 0x00000000;// 草稿
    public static final int STATE_YIBAOJIA = 0x00000001;// 已报价
    public static final int STATE_SHENHEZHONG = 0x00000002;// 审核中
    public static final int STATE_SHENHETONGGUO = 0x00000003;// 审核通过
    public static final int STATE_SHENHEBOHUI = 0xfffffffd;// 审核驳回
    public static final int STATE_XINXIJILUGENGXIN = 0x00000004;// 更新信息记录
    public static final int STATE_XINXIJILUGENGXINGG = 0x00000005;// 更新信息记录

    private static final long serialVersionUID = 1L;

    public InquiryQuotationEntity() {
        super();
    }

    /*
     * 报价单ID
     */
    @TableId(value = "quotation_id", type = IdType.UUID)
    @TableField("quotation_id")
    @Excel(name = "报价单ID", orderNum = "1")
    private java.lang.String quotationId;

    /*
     * 询价报价单号
     */
    @TableField("inquiry_code")
    @Excel(name = "询价报价单号", orderNum = "2")
    private java.lang.String inquiryCode;

    /*
     * 询价单ID
     */
    @TableField("inquiry_id_")
    @Excel(name = "询价单ID", orderNum = "3")
    private java.lang.String inquiryId;

    /*
     * 汇总号
     */
    @TableField("inquiry_total_code")
    @Excel(name = "汇总号", orderNum = "4")
    private java.lang.String inquiryTotalCode;

    /*
     * 询价单行项目ID
     */
    @TableField("inquiry_item_id_")
    @Excel(name = "询价单行项目ID", orderNum = "5")
    private java.lang.String inquiryItemId;

    /*
     * 询价行项目号
     */
    @TableField("inquiry_item_code")
    @Excel(name = "询价行项目号", orderNum = "6")
    private java.lang.String inquiryItemCode;

    /*
     * 询价单供应商信息ID
     */
    @TableField("inquiry_vendor_id_")
    @Excel(name = "询价单供应商信息ID", orderNum = "7")
    private java.lang.String inquiryVendorId;

    /*
     * 供应商编码
     */
    @TableField("vendor_code")
    @Excel(name = "供应商编码", orderNum = "8")
    private java.lang.String vendorCode;

    /*
     * 供应商名称
     */
    @TableField("vendor_name")
    @Excel(name = "供应商名称", orderNum = "9")
    private java.lang.String vendorName;

    /*
     * 净价
     */
    @TableField("price")
    @Excel(name = "净价", orderNum = "10")
    private java.math.BigDecimal price;

    /*
     * 总价
     */
    @TableField("total_price")
    @Excel(name = "总价", orderNum = "11")
    private java.math.BigDecimal totalPrice;

    /*
     * 最小起订量
     */
    @TableField("price_unit")
    @Excel(name = "价格单位", orderNum = "12")
    private java.lang.String priceUnit;

    /*
     * 订单价格单位(采购)
     */
    @TableField("po_price_unit")
    @Excel(name = "订单价格单位(采购)", orderNum = "13")
    @DictMapping(type = DictDataUtil.DictType.JLDW)
    private java.lang.String poPriceUnit;

    /*
     * 销售/购买税代码
     */
    @TableField("tax_code")
    @Excel(name = "销售/购买税代码", orderNum = "14")
    @DictMapping(type = DictType.SDM)
    private java.lang.String taxCode;

    /*
     * 创建时间
     */
    @TableField("creation_date")
    @Excel(name = "创建时间", orderNum = "15")
    private java.sql.Timestamp creationDate;

    /*
     * 创建者
     */
    @TableField("created_by")
    @Excel(name = "创建者", orderNum = "16")
    private java.lang.String createdBy;

    /*
     * 修改日期
     */
    @TableField("last_update_date")
    @Excel(name = "修改日期", orderNum = "17")
    private java.sql.Timestamp lastUpdateDate;

    /*
     * 修改人
     */
    @TableField("last_updated_by")
    @Excel(name = "修改人", orderNum = "18")
    private java.lang.String lastUpdatedBy;

    /*
     * 删除标识
     */
    @TableField("delete_flag")
    @Excel(name = "删除标识", orderNum = "19")
    private int deleteFlag;

    /*
     * 回复交期
     */
    @TableField("reply_delivery_date")
    @Excel(name = "回复交期", orderNum = "20")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date replyDeliveryDate;

    /*
     * 回复交期时间录入时间
     */
    @TableField("reply_update_date")
    @Excel(name = "回复交期时间录入时间", orderNum = "21")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private java.sql.Timestamp replyUpdateDate;

    /*
     * 回复交期录入人
     */
    @TableField("reply_update_by")
    @Excel(name = "回复交期录入人", orderNum = "22")
    private java.lang.String replyUpdateBy;

    /*
     * 状态：草稿、已报价
     */
    @TableField("state_")
    @Excel(name = "状态：0草稿、1已报价、2已报审核、3审核通过、-3审核驳回", orderNum = "23")
    private int state;

    /*
     *
     */
    @TableField("edition")
    @Excel(name = "", orderNum = "24")
    private java.lang.String edition;

    /*
     * 采购申请编码
     */
    @TableField("request_code")
    @Excel(name = "", orderNum = "25")
    private java.lang.String requestCode;

    /*
     *
     */
    @TableField("npk_id")
    @Excel(name = "采购申请行项目pkid", orderNum = "26")
    private java.lang.String npkId;

    /*
     *
     */
    @TableField("quantity")
    @Excel(name = "货源分配所得数量", orderNum = "27")
    private java.lang.String quantity;

    /*
     * OA审批单id
     */
    @TableField("oa_doc_id")
    @Excel(name = "", orderNum = "28")
    private java.lang.String oaDocId;

    @TableField("currency")
    @Excel(name = "币种", orderNum = "29")
    @DictMapping(type = DictType.BZ)
    private java.lang.String currency;

    /*
     *
     */
    @TableField("werks")
    @Excel(name = "", orderNum = "30")
    @DictMapping(type = DictDataUtil.DictType.GC)
    private java.lang.String werks;


    /*
     *
     */
    @TableField("purchase_org")
    @Excel(name = "", orderNum = "32")
    private java.lang.String purchaseOrg;

    /*
     *
     */
    @TableField("purchase_grp")
    @Excel(name = "", orderNum = "33")
    private java.lang.String purchaseGrp;

    @TableField("material_group")
    @Excel(name = "物料组", orderNum = "34")
    @DictMapping(type = DictType.WLZ)
    private java.lang.String materialGroup;


    @TableField("remark")
    @Excel(name = "备注", orderNum = "35")
    private java.lang.String remark;


    @TableField("created_date")
    @Excel(name = "oa审批通过时间", orderNum = "36")
    private java.util.Date createdDate;

    /**
     * 数量
     */
    @TableField(exist = false)
    private String purchaseCnt;
    /**
     * sap编码
     */
    @TableField(exist = false)
    private String sapCode;

    /**
     * 供应商付款条件
     */
    @TableField(exist = false)
    @DictMapping(type = DictType.FKTJ)
    private String payCondition;

    /**
     * 物料编码
     */
    @TableField("material_code")
    private String materialCode;
    /**
     * 物料描述
     */
    @TableField("material_desc ")
    private String materialDesc;

    /**
     * 订单单位
     */
    @TableField(exist = false)
    private String poUnit;

    /**
     * 用户邮件
     */
    @TableField(exist = false)
    private String email;

    /**
     * 第一次询价
     */
    @TableField("first_enquiry_price")
    private String firstEnquiryPrice;

    /**
     * 第二次询价
     */
    @TableField("second_enquiry_price ")
    private String secondEnquiryPrice;

    /**
     * 最终价
     */
    @TableField("last_enquiry_price ")
    private String lastEnquiryPrice;

    @TableField(exist = false)
    private NproPurchRequestItemEntity nproPurchRequestItemEntity = new NproPurchRequestItemEntity();

    @TableField(exist = false)
    private String attachment;
    @TableField(exist = false)
    private String compCode;

    @Override
    public InquiryQuotationEntity clone() {
        try {
            return (InquiryQuotationEntity) super.clone();
        } catch (CloneNotSupportedException ex) {
            // TODO Auto-generated catch block
            ex.printStackTrace();
        }
        return null;
    }
}
